package com.zl.csMall.mine.notice.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zl.csMall.code.config.token.TokenTriggerAspect;
import com.zl.csMall.mine.notice.po.Notice;
import com.zl.csMall.mine.notice.service.NoticeService;
import com.zl.csMall.vo.ReturnModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: NoticeController
 * @author: ChenNing
 * @date 2025-10-24 11:11
 */
@CrossOrigin(origins = "*")
@Api(tags = "消息通知")
@RestController
@RequestMapping("csMall/mine/notice")
public class NoticeController {

    @Autowired
    private NoticeService noticeService;


    /**
     * @description: 查询发货通知
     * @author ChenNing
     * @date: 2025-10-24 11:24
     */
    @TokenTriggerAspect
    @ApiOperation(value = "查询发货通知 - 商家", response = Notice.class)
    @CrossOrigin("*")
    @GetMapping
    public ReturnModel getAll(@RequestHeader(required = false) String token,
                              @RequestParam("pageNum") int pageNum, @RequestParam("pageSize") int pageSize){
        Page<Notice> noticePage = noticeService.getAll(new Page<>(pageNum, pageSize));
        return new ReturnModel(noticePage);
    }

}
